import NavBar from '@/components/common/NavBar';
import UseInput from '@/components/common/UseInput';
import { imgAddPrefix } from '@/utils';
import { Cross } from '@taroify/icons';
import { View, Image } from '@tarojs/components';
import Taro, { useDidShow } from '@tarojs/taro';
import { useState } from 'react';

export default () => {
  useDidShow(() => Taro.hideTabBar());
  function back() {
    setTimeout(() => {
      Taro.showTabBar();
      Taro.switchTab({ url: '/pages/home/home' });
    }, 1000);
  }
  const [cover, setCover] = useState('/icon/index.png');
  return (
    <NavBar left={<Cross size={22} onClick={back} />} title=" ">
      <View className="flex flex-col items-center justify-center gap-4 px-6">
        <View>
          <Image src={imgAddPrefix(cover)} className="w-8/12 h-48" />
        </View>
        <UseInput left="标题" />
        <UseInput left="正文" />
      </View>
    </NavBar>
  );
};
